<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>css_遮罩层</title>

  <style>
    *{
      margin: 0;
      padding: 0;
    }
     .zhezhao {

      position: absolute;
      /* top: -375px; */
      left: 0;
      width: 600px;
      /* height: 375px; */
      /* z-index: -99; */
      pointer-events: none;
      line-height: 375px;
      text-align: center;
      font-size: 30px;
      color: #fff;

      background-color: rgba(6, 6, 6, 0.2);
    }


    .box {
      /* 相对定位 */
      position: relative;
      width: 600px;
      height: 375px;
      background: url(./images/1.jpg);
      background-size: contain;
      /* overflow: hidden; */
    }



    .box:hover .zhezhao {
      top: 0;
    
      animation: dropdown 1s forwards;
    }


    @keyframes dropdown {
      0% {
        top: -375px;
        height: 0px;
      }



      100% {
        top: 0;
        height: 375px;
        /* top:30px */
      }
    }

  
  </style>
</head>

<body>
  <div class="box">
    <div class="zhezhao">

    </div>
  </div>
</body>

</html>